home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
ms_dos
/
tool
/
dmove86
/
abssec2.a86
next >
Wrap
Text File
|
1994-05-20
|
2KB
|
127 lines
; ディスクの直接操作関数
CGROUP group TEXT
TEXT CSEG
;
;readabssec(void far *buf, unsigned long sector,unsigned secno,int drive)
;
;BXAX==buf, DXCX==sector,[BP+4]==secno,[BP+6]==drive
;
;リターン値の上位8ビットがCF、下位8ビットがALの値
readabssec_::
push BP
mov BP,SP
push DS
push CX
push DX
push SI
push DI
cmp [_osmajor_##].B,4
jc rdabs_16bit
rdabs_32bit:
sub SP,10
mov DI,BX
mov BX,SP
mov SI,SS
mov DS,SI
mov [BX],CX ; sector(Low)
mov [BX+2],DX ; sector(High)
mov DX,[BP+4]
mov [BX+4],DX ; secno
mov [BX+6],AX ; buf(offset)
mov [BX+8],DI ; buf(segment)
mov AL,[BP+6]
mov CX,-1
int 25h
add SP,12
jmp rdabs_endop
rdabs_16bit:
mov DS,BX
mov BX,AX
mov DX,CX
mov CX,[BP+4]
mov AL,[BP+6]
int 25h
pop CX
rdabs_endop:
pop DI
pop SI
pop DX
pop CX
pop DS
pop BP
sbb AH,AH
ret
;
;writeabssec(void far *buf, unsigned long sector,unsigned secno,int drive)
;
;BXAX==buf, DXCX==sector,[BP+4]==secno,[BP+6]==drive
;
;リターン値の上位8ビットがCF、下位8ビットがALの値
writeabssec_::
push BP
mov BP,SP
push DS
push CX
push DX
push SI
push DI
cmp [_osmajor_##].B,4
jc wrabs_16bit
wrabs_32bit:
sub SP,10
mov DI,BX
mov BX,SP
mov SI,SS
mov DS,SI
mov [BX],CX ; sector(Low)
mov [BX+2],DX ; sector(High)
mov DX,[BP+4]
mov [BX+4].W,DX ; secno
mov [BX+6],AX ; buf(offset)
mov [BX+8],DI ; buf(segment)
mov AL,[BP+6]
mov CX,-1
int 26h
add SP,12
jmp wrabs_endop
wrabs_16bit:
mov DS,BX
mov BX,AX
mov DX,CX
mov CX,[BP+4]
mov AL,[BP+6]
int 26h
pop CX
wrabs_endop:
pop DI
pop SI
pop DX
pop CX
pop DS
pop BP
sbb AH,AH
ret